package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.HmzInventoryMapper;
import com.ruoyi.system.domain.HmzInventory;
import com.ruoyi.system.service.IHmzInventoryService;

/**
 * 用于存储库存信息的Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-11-10
 */
@Service
public class HmzInventoryServiceImpl implements IHmzInventoryService 
{
    @Autowired
    private HmzInventoryMapper hmzInventoryMapper;

    /**
     * 查询用于存储库存信息的
     * 
     * @param warehouseId 用于存储库存信息的主键
     * @return 用于存储库存信息的
     */
    @Override
    public HmzInventory selectHmzInventoryByWarehouseId(Long warehouseId)
    {
        return hmzInventoryMapper.selectHmzInventoryByWarehouseId(warehouseId);
    }

    /**
     * 查询用于存储库存信息的列表
     * 
     * @param hmzInventory 用于存储库存信息的
     * @return 用于存储库存信息的
     */
    @Override
    public List<HmzInventory> selectHmzInventoryList(HmzInventory hmzInventory)
    {
        return hmzInventoryMapper.selectHmzInventoryList(hmzInventory);
    }

    /**
     * 新增用于存储库存信息的
     * 
     * @param hmzInventory 用于存储库存信息的
     * @return 结果
     */
    @Override
    public int insertHmzInventory(HmzInventory hmzInventory)
    {
        hmzInventory.setCreateTime(DateUtils.getNowDate());
        return hmzInventoryMapper.insertHmzInventory(hmzInventory);
    }

    /**
     * 修改用于存储库存信息的
     * 
     * @param hmzInventory 用于存储库存信息的
     * @return 结果
     */
    @Override
    public int updateHmzInventory(HmzInventory hmzInventory)
    {
        hmzInventory.setUpdateTime(DateUtils.getNowDate());
        return hmzInventoryMapper.updateHmzInventory(hmzInventory);
    }

    /**
     * 批量删除用于存储库存信息的
     * 
     * @param warehouseIds 需要删除的用于存储库存信息的主键
     * @return 结果
     */
    @Override
    public int deleteHmzInventoryByWarehouseIds(Long[] warehouseIds)
    {
        return hmzInventoryMapper.deleteHmzInventoryByWarehouseIds(warehouseIds);
    }

    /**
     * 删除用于存储库存信息的信息
     * 
     * @param warehouseId 用于存储库存信息的主键
     * @return 结果
     */
    @Override
    public int deleteHmzInventoryByWarehouseId(Long warehouseId)
    {
        return hmzInventoryMapper.deleteHmzInventoryByWarehouseId(warehouseId);
    }
}
